<?php

/**
 * [simcool]
 *
 * @package simcool
 * @author shean
 * @version 2024-12
 * @link http://doubao.life
 */
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
?>
<!DOCTYPE HTML>
<html lang="zh-cn">

<head><?php $this->need('header.php'); ?></head>

<body>
    <div class="container">
        <div class="columns">
            <!-- cover pc-only -->
            <div class="column col-4 px-0 hide-sm">
                <?php $this->need('cover-today.php'); ?>
            </div>
            <!-- page -->
            <div class="column col-8 col-sm-12 px-0">
                <!-- menu -->
                <div class="container p-0">
                    <?php $this->need('menu.php'); ?>
                </div>
                <!-- cont -->
                <div class="container">
                    <div class="columns">
                        <!-- left -->
                        <div class="column col-3 col-sm-3 px-0">
                            <!-- cate-menu -->
                            <?php $this->need('cateMenu.php'); ?>
                        </div>
                        <!-- right -->
                        <div class="column col-9 col-sm-9 p-0">
                            <!-- page body -->
                            <div class="scroller-y" style="height: calc(100vh - 42px);">
                                <!-- carousel -->
                                <?php if ($this->options->home_corousel == '1'): ?>
                                    <?php $this->need('carousel.php'); ?>
                                <?php endif; ?>

                                <!-- welcome -->
                                <div class="block-space" style="padding-top: 30px;">
                                    <div class="columns">
                                        <div class="column col-12">
                                            <div class="bg-image img-contain site_cover" style="background-image:url('<?php $this->options->themeUrl(); ?>/images/logo.png');"></div>
                                        </div>
                                        <div class="column col-7 col-sm-12 col-mx-auto">
                                            <div class="d-flex a-center" style="width:unset;">
                                                <div class="site_desc">
                                                    <?php $this->options->site_desc(); ?>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </div>

                                <!-- tags -->
                                <div class="block-space">
                                    <?php

                                    $this->widget('Widget_Metas_Tag_Cloud')->to($tags);
                                    if ($tags->have()):
                                        $tag_count = 0;
                                        $tag_num = 9;
                                    ?>
                                        <div class=" columns">
                                            <div class="column col-6 col-sm-12">
                                                <div class="hotword-item hotword-title">
                                                    <div class="sub">标签</div>
                                                    <div class="main f1">tags</div>
                                                </div>
                                            </div>
                                            <?php while ($tags->next() && $tag_count < $tag_num) : ?>
                                                <?php $tag_count++; ?>
                                                <div class="column col-3 col-sm-6">
                                                    <div class="hotword-item d-flex a-center j-center" style="width:unset;">
                                                        <a class="link" href="<?php $tags->permalink(); ?>" title="<?php $tags->count(); ?> 篇文章">
                                                            <?php $tags->name(); ?>
                                                        </a>
                                                    </div>
                                                </div>
                                            <?php endwhile; ?>
                                            <div class="column col-3 col-sm-6">
                                                <div class="hotword-item d-flex a-center j-center" style="width:unset;">
                                                    <a class="link" href="<?php echo $this->options->siteUrl . 'index.php/tags.html' ?>" title="查看全部标签">
                                                        <i class="icon icon-more-horiz"></i>
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                    <?php endif; ?>
                                </div>

                                <!-- 最近回复 -->
                                <div class="block-space">
                                    <?php
                                    $this->widget('Widget_Comments_Recent')->to($recent_comment);
                                    $comt_count = 0;
                                    $comt_num = 5;
                                    ?>
                                    <div class="columns">
                                        <div class="column col-6 col-sm-12">
                                            <div class="-comment-item">
                                                <div class="hotword-item hotword-title">
                                                    <div class="sub">最新回复</div>
                                                    <div class="main f1">message</div>
                                                </div>
                                            </div>
                                        </div>
                                        <?php while ($recent_comment->next() && $comt_count < $comt_num): ?>
                                            <?php $comt_count++; ?>
                                            <div class="column col-6 col-sm-12">
                                                <div class="-comment-item">
                                                    <div class="-comment-item-title"><?php $recent_comment->author(false); ?>&nbsp;说：</div>
                                                    <div class="text-tiny -comment-item-cont">
                                                        <?php $recent_comment->excerpt(50, ''); ?>
                                                    </div>
                                                    <div class="d-flex a-center j-end -comment-item-foot">
                                                        <div class="text-tiny text-gray"><?php $recent_comment->date('Y-m-d'); ?></div>
                                                        <div class="">
                                                            <div onclick="location.href='<?php $recent_comment->permalink(); ?>';" class="-icon -link c-hand mx-1" style="width:15px;height:15px;"></div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        <?php endwhile; ?>

                                    </div>
                                </div>

                                <!-- hot words -->
                                <div class=" block-space">
                                    <?php $hotwords = getSinaHotWord() ?>
                                    <div class="columns">
                                        <div class="column col-6 col-sm-12">
                                            <div class="hotword-item hotword-title">
                                                <div class="sub">热搜</div>
                                                <div class="main">hotword</div>
                                            </div>
                                        </div>
                                        <?php foreach ($hotwords as $key => $val): ?>
                                            <div class="column col-3 col-sm-12">
                                                <div class="hotword-item" title="<?php echo $val['title']; ?>" onclick="window.open('<?php echo $val['url']; ?>');">
                                                    <div class="no">
                                                        <?php echo ($key + 1); ?>
                                                    </div>
                                                    <div class="content">
                                                        <?php echo $val['title']; ?>
                                                    </div>
                                                </div>
                                            </div>
                                        <?php endforeach; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <?php $this->need('footer.php'); ?>
    </div>
</body>

</html>